package com.cleaningcloud.cld.mapper;

import java.util.List;
import com.cleaningcloud.cld.domain.CldCheckPerformance;
import com.cleaningcloud.cld.domain.dto.CldCheckPerformanceDto;
import com.cleaningcloud.cld.domain.dto.CldCheckResultDto;
import com.cleaningcloud.cld.domain.vo.CldCheckPerformanceVo;
import com.cleaningcloud.cld.domain.vo.CldCheckResultVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

/**
 * 绩效考核Mapper接口
 * 
 * @author cleaningcloud
 * @date 2024-10-12
 */
public interface CldCheckPerformanceMapper 
{
    /**
     * 查询绩效考核
     * 
     * @param performanceId 绩效考核主键
     * @return 绩效考核
     */
    CldCheckPerformanceVo selectCldCheckPerformanceByPerformanceId(Long performanceId);

    /**
     * 查询绩效考核列表
     * 
     * @param cldCheckPerformance 绩效考核
     * @return 绩效考核集合
     */
    List<CldCheckPerformanceVo> selectCldCheckPerformanceList(CldCheckPerformance cldCheckPerformance);

    /**
     * 新增绩效考核
     * 
     * @param cldCheckPerformance 绩效考核
     * @return 结果
     */
    int insertCldCheckPerformance(CldCheckPerformanceDto cldCheckPerformance);

    /**
     * 修改绩效考核
     * 
     * @param cldCheckPerformance 绩效考核
     * @return 结果
     */
    int updateCldCheckPerformance(CldCheckPerformance cldCheckPerformance);

    /**
     * 删除绩效考核
     * 
     * @param performanceId 绩效考核主键
     * @return 结果
     */
    int deleteCldCheckPerformanceByPerformanceId(Long performanceId);

    /**
     * 批量删除绩效考核
     * 
     * @param performanceIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteCldCheckPerformanceByPerformanceIds(Long[] performanceIds);


    /**
     * 批量新增考核结果明细
     * @param list
     */
    void batchCheckResultInsert(@Param("list")List<CldCheckResultDto> list);

    /**
     * 根据考核id批量删除
     * @param templateId
     */
    @Delete("delete from cld_check_result where performance_id = #{performanceId}")
    void deleteCheckResultByPerformanceId(@Param("performanceId") Long performanceId);

    /**
     * 根据考核id查询考核结果明细
     * @param performanceId
     * @return
     */
    List<CldCheckResultVo> selectCldCheckResultByPerformanceId(@Param("performanceId") Long performanceId);
}
